# 石头剪刀布用列表进行游戏
import random
guess_list = ["石头", "剪刀", "布"]
rule = [["布", "石头"], ["石头", "剪刀"], ["剪刀", "布"]]

while True:
    # 方法返回一个列表，元组或字符串的随机项。
    computer = random.choice(guess_list)
    people = input('请输入：石头,剪刀,布\n')

    if people not in guess_list:
        people = input('重新请输入：石头,剪刀,布\n')

        continue
    if computer == people:
        print("平手，再玩一次！")

    elif [computer, people] in rule:
        print("电脑获胜！")
    else:
        print("你获胜了！")
        break


# 一个学校、8个老师、3个教室随机分教室


# # 用任意语言循环输出0-10的正数
# for i in range(0, 11):
#     print(i)
#
# # 用任意语言逆序输出一个字符串 ='欢乐逛欢迎你'
# str1 = '欢乐逛欢迎你'
# print(str1[-1:-6:-1])
#
# # str='a,hello'在字符串str中寻找hello
# my_str = 'a,hello'
# a = my_str.find("hello")
# print(a)
#
# # str2='a,b,c,d'用逗号分隔str字符串，并保存到列表
# str2 = 'a,b,c,d'
# b = str2.split()
# print(b)
#
# # 将‘笔试题123A’中123A替换为'进行中'
# str3 = '笔试题123A'
# c = str3.replace('123A', '进行中')
# print(c)



